package com.shortvedio.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shortvedio.base.model.dto.VedioContentDto;
import com.shortvedio.base.model.po.UserFavorites;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserFavoritesMapper extends BaseMapper<UserFavorites> {
    @Select("SELECT * FROM videos_content WHERE id IN (SELECT video_id FROM user_favorites WHERE favorites = #{favorites}) AND status = 2 LIMIT #{start}, #{size}")
    public List<VedioContentDto> selectFavoritesList(@Param("favorites") Long favorites, @Param("start") Integer start, @Param("size") Integer size);
}
